<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>对象</title>
    <script src="../js/vue.js"></script>
</head>

<body>
    <div id="app">
        <h3>姓名：{{info.username}}</h3>
        <h3>年龄：{{info.userage}}</h3>
        <h3>电话：{{info.usertel}}</h3>
        <h3>Q Q：{{info.userqq}}</h3>
        <button @click="add">新增</button>


    </div>

</body>
<script>

    new Vue({
        el: "#app",
        data: {
            info: {
                username: "请问",
                userage: 18,
                usertel: 123456
            }
        },
        methods: {
            add() {
                // this.data = { ...this.data, userqq: 147258 }
                this.$set(this.info, "userqq", 147258)
            }
        }



    })



</script>

</html>